home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / RGASM.RAR / ASMCODE.EXE / CHAPT1-5 / HELLO1.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-05-10  |  1.3 KB  |  26 lines

  1. ;        
  2. ;       Program Hello1 ( Chapter 3 )        
  3. ;        
  4.         TITLE    Hello1 Example Program 1   ; title is not necessary
  5. OurCode SEGMENT  PARA  PUBLIC  'CODE'      ; declare code segment
  6.         ASSUME   CS:OurCode, DS:OurData, SS:OurStack 
  7. Start:  MOV      AX,OurData                ; copy address of data
  8.         MOV      DS,AX                     ; segment into DS
  9.         LEA      DX,Hello                  ; address of message
  10.         MOV      AH,09h                    ; DOS service "output text string"
  11.         INT      21h                       ; DOS service call
  12.         MOV      AH,4Ch                    ; DOS service "terminate process"
  13.         MOV      AL,00h                    ; return code zero   
  14.         INT      21h                       ; DOS service call
  15. OurCode ENDS                               ; end of code segment
  16.  
  17. OurData SEGMENT  PARA PUBLIC 'DATA'        ; declare data segment
  18. Hello   DB       'Hello!$'                 ; define string to display
  19. OurData ENDS                               ; end of data segment
  20.  
  21. OurStack SEGMENT PARA STACK 'STACK'        ; declare stack segment
  22.         DB       64 DUP (?)                ; reserve 64 bytes
  23. OurStack ENDS                              ; end of stack segment
  24.  
  25.         END       Start                    ; end of program
  26.